const Base = require("../base.js");
const txyoss = require("../public/txyoss");
module.exports = class extends Base {
  async indexAction() {
    const base64 = this.post("base64");
    var dataBuffer = new Buffer(base64, "base64");
    let imgurl = await txyoss.upbuff(dataBuffer, this.post('qmname') || "qm", this.post('ge') || ".jpg");
    this.success(imgurl);
  }
  // 异常的图片
  async ycAction() {
    const base64 = this.post("base64");
    var dataBuffer = new Buffer(base64, "base64");
    let imgurl = await txyoss.upbuff(dataBuffer, this.post('names') || "yc", ".jpg");
    this.success(imgurl + '?imageMogr2/format/webp');
  }
};